package android.slc.module.project.ui.browser;

import android.slc.base.utils.AppPathUtils;
import android.slc.jxbrowser.JxBrowserUtils;
import cn.hutool.core.util.StrUtil;

public class AppJxBrowserUtils extends JxBrowserUtils {
    public final static String JX_BROWSER_USER_DATA = AppPathUtils.createAppCacheFile("JxBrowserUserData").getAbsolutePath();
    public final static String JX_BROWSER_CHROMIUM_DIR = AppPathUtils.createAppCacheFile("ChromiumDir").getAbsolutePath();

    public static String getUserDataDir() {
        if (StrUtil.isNotEmpty(JxBrowserUtils.userDataDir)) {
            return JxBrowserUtils.userDataDir;
        }
        return JX_BROWSER_USER_DATA;
    }

    public static String getChromiumDir() {
        if (StrUtil.isNotEmpty(JxBrowserUtils.chromiumDir)) {
            return JxBrowserUtils.chromiumDir;
        }
        return JX_BROWSER_CHROMIUM_DIR;
    }
}
